/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package datastorage;

/**
 *
 * @author Kvest
 */
public class PositionsExtraDataStorage 
{
    private static final String LAST_UPDATE_KEY = "last_upadte";
    private static final String UID_KEY = "uid";
    
    private static String RMS_NAME = "pedDB";
    
    private RMSManager rmsManager;
    
    public PositionsExtraDataStorage()
    {
        rmsManager = new RMSManager(RMS_NAME);
        rmsManager.load();
    }
    
    public long getLastUpdate()
    {
        return rmsManager.getLong(LAST_UPDATE_KEY, 0); 
    }
    
    public void setLastUpdate(long value)
    {
        //Устанавливаем и сохраняем
        rmsManager.set(LAST_UPDATE_KEY, value);
        rmsManager.save();
    }
    
    public int getUID()
    {
        return rmsManager.getInt(UID_KEY, -1);
    }
    
    public void setUID(int value)
    {
        //Устанавливаем и сохраняем
        rmsManager.set(UID_KEY, value);
        rmsManager.save();
    }
}
